package cn.yuanqiao.archive.danganzhengli.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.lang.reflect.Field;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zjj
 * @date 2024/3/14
 */
public class YqdaOnlineReception {
    @IdAnnotation
    private Long id;

    /*状态 0=待移交 1=移交中 2=已移交 99=已取消*/
    private Integer state;

    /*交接工作名称*/
    @NotBlank(message = "交接工作名称不能为空")
    @Size(min = 0, max = 400, message = "交接工作名称不能超过400个字符")
    @Excel(name = "交接工作名称")
    private String name;

    /*内容描述*/
    @Excel(name = "内容描述")
    private String description;

    /*档案件数量*/
    @Excel(name = "移交电子档案数量")
    private Integer daCount;

    /*数据容量 GB*/
    @Excel(name = "移交数据容量")
    private String capacity;

    /*在线onLine 离线outLine */
    @NotBlank(message = "移交类型不能为空")
    @Excel(name = "移交方式",readConverterExp="onLine=在线移交,outLine=离线移交")
    private String type;

    /*载体类型*/
    @Excel(name = "移交载体类型")
    private String carrier;

    /*载体数量*/
    @Excel(name = "移交载体数量")
    private String carrierCount;

    /*起止年度*/
    @Excel(name = "移交电子档案起止年度")
    private String nd;

    /*起止档号*/
    @Excel(name = "移交电子档案起止档号")
    private String dh;

    /*移交单位*/
    @Excel(name = "移交单位名称")
    private String yjUnit;

    /*接收单位*/
    @Excel(name = "接收单位")
    private String jsUnit;

    /*载体外观*/
    @Excel(name = "载体外观检测")
    private String appearance;

    /*真实性*/
    @Excel(name = "真实性检测")
    private String trueExplain;

    /*完整性*/
    @Excel(name = "完整性检测")
    private String integrityExplain;

    /*可用性*/
    @Excel(name = "可用性检测")
    private String usableExplain;

    /*安全性*/
    @Excel(name = "安全性检测")
    private String secureExplain;

    /*创建人 */
    private Long createId;

    /** 创建者 */
    private String createBy;

    /*接收时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date receptionTime;

    /** 创建时间 */
    //@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "移交时间")
    private String createTime;

    /*审核人*/
    @Excel(name = "移交单审核人")
    private String auditorBy;

    /*审核人*/
    private Long auditorId;

    /*审核时间*/
    @Excel(name = "移交单审核日期")
    private String auditorTime;

    /*单位*/
    @Excel(name = "移交单位")
    private String unitBy;

    /*单位*/
    private Long unitId;

    /*单位确认时间*/
    @Excel(name = "移交单位审核时间")
    private String unitTime;

    /*接收状态 0=未接收 1=已接受 2=退回 废弃*/
    private Integer receiveState;

    /*说明、意见*/
    private String illustrate;

    /**
     * 流程id
     */
    private String activitiId;

    /**
     * 填写人
     */
    @Excel(name = "移交单位填表人")
    private String writtenBy;

    /**
     * 填写时间
     */
    @Excel(name = "移交单位填表日期")
    private String writtenTime;

    /* 移交状态 */
    private Integer yjState;

    /* 接收状态 */
    private Integer jsState;

    private Long siXingId;

    private Long categoryId;

    private String filePath;

    private String tenantCode;

    /*四性检测结果   通过   不通过*/
    private String siXingResult;

    /*唯一标识*/
    private String biaoShi;

    @Excel(name = "移交租户编码")
    private String oldTenantCode;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getDaCount() {
        return daCount;
    }

    public void setDaCount(Integer daCount) {
        this.daCount = daCount;
    }

    public String getCapacity() {
        return capacity;
    }

    public void setCapacity(String capacity) {
        this.capacity = capacity;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCarrier() {
        return carrier;
    }

    public void setCarrier(String carrier) {
        this.carrier = carrier;
    }

    public String getCarrierCount() {
        return carrierCount;
    }

    public void setCarrierCount(String carrierCount) {
        this.carrierCount = carrierCount;
    }

    public String getNd() {
        return nd;
    }

    public void setNd(String nd) {
        this.nd = nd;
    }

    public String getDh() {
        return dh;
    }

    public void setDh(String dh) {
        this.dh = dh;
    }

    public String getAppearance() {
        return appearance;
    }

    public void setAppearance(String appearance) {
        this.appearance = appearance;
    }

    public String getTrueExplain() {
        return trueExplain;
    }

    public void setTrueExplain(String trueExplain) {
        this.trueExplain = trueExplain;
    }

    public String getIntegrityExplain() {
        return integrityExplain;
    }

    public void setIntegrityExplain(String integrityExplain) {
        this.integrityExplain = integrityExplain;
    }

    public String getUsableExplain() {
        return usableExplain;
    }

    public void setUsableExplain(String usableExplain) {
        this.usableExplain = usableExplain;
    }

    public String getSecureExplain() {
        return secureExplain;
    }

    public void setSecureExplain(String secureExplain) {
        this.secureExplain = secureExplain;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public String getAuditorBy() {
        return auditorBy;
    }

    public void setAuditorBy(String auditorBy) {
        this.auditorBy = auditorBy;
    }

    public Long getAuditorId() {
        return auditorId;
    }

    public void setAuditorId(Long auditorId) {
        this.auditorId = auditorId;
    }

    public String getAuditorTime() {
        return auditorTime;
    }

    public void setAuditorTime(String auditorTime) {
        this.auditorTime = auditorTime;
    }

    public String getUnitBy() {
        return unitBy;
    }

    public void setUnitBy(String unitBy) {
        this.unitBy = unitBy;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public String getUnitTime() {
        return unitTime;
    }

    public void setUnitTime(String unitTime) {
        this.unitTime = unitTime;
    }

    public Integer getReceiveState() {
        return receiveState;
    }

    public void setReceiveState(Integer receiveState) {
        this.receiveState = receiveState;
    }

    public String getIllustrate() {
        return illustrate;
    }

    public void setIllustrate(String illustrate) {
        this.illustrate = illustrate;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getWrittenBy() {
        return writtenBy;
    }

    public void setWrittenBy(String writtenBy) {
        this.writtenBy = writtenBy;
    }

    public String getWrittenTime() {
        return writtenTime;
    }

    public void setWrittenTime(String writtenTime) {
        this.writtenTime = writtenTime;
    }

    public String getYjUnit() {
        return yjUnit;
    }

    public void setYjUnit(String yjUnit) {
        this.yjUnit = yjUnit;
    }

    public String getJsUnit() {
        return jsUnit;
    }

    public void setJsUnit(String jsUnit) {
        this.jsUnit = jsUnit;
    }

    public Integer getYjState() {
        return yjState;
    }

    public void setYjState(Integer yjState) {
        this.yjState = yjState;
    }

    public Integer getJsState() {
        return jsState;
    }

    public void setJsState(Integer jsState) {
        this.jsState = jsState;
    }

    public Long getSiXingId() {
        return siXingId;
    }

    public void setSiXingId(Long siXingId) {
        this.siXingId = siXingId;
    }

    public String getActivitiId() {
        return activitiId;
    }

    public void setActivitiId(String activitiId) {
        this.activitiId = activitiId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public Date getReceptionTime() {
        return receptionTime;
    }

    public String getOldTenantCode() {
        return oldTenantCode;
    }

    public void setOldTenantCode(String oldTenantCode) {
        this.oldTenantCode = oldTenantCode;
    }

    public void setReceptionTime(Date receptionTime) {
        this.receptionTime = receptionTime;
    }

    public Map<String, Object> toProcessMap() {
        Map<String, Object> map = new HashMap<>();

        // 使用反射获取实体类的字段信息
        Class<?> clazz = this.getClass();
        Field[] fields = clazz.getDeclaredFields();

        try {
            // 遍历所有字段，获取字段名和字段值，并存储到 Map 中
            for (Field field : fields) {
                if (field.getType().isAssignableFrom(Date.class)){
                    continue;
                }
                field.setAccessible(true); // 设置字段可访问，即使是私有字段也可以获取值
                String fieldName = field.getName();
                Object fieldValue = field.get(this); // 获取字段的值
                map.put(fieldName, fieldValue);
            }
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }

        return map;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getBiaoShi() {
        return biaoShi;
    }

    public void setBiaoShi(String biaoShi) {
        this.biaoShi = biaoShi;
    }

    public String getSiXingResult() {
        return siXingResult;
    }

    public void setSiXingResult(String siXingResult) {
        this.siXingResult = siXingResult;
    }

    @Override
    public String toString() {
        return "YqdaOnlineReception{" +
                "id=" + id +
                ", state=" + state +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", daCount=" + daCount +
                ", capacity='" + capacity + '\'' +
                ", type='" + type + '\'' +
                ", carrier='" + carrier + '\'' +
                ", carrierCount='" + carrierCount + '\'' +
                ", nd='" + nd + '\'' +
                ", dh='" + dh + '\'' +
                ", yjUnit='" + yjUnit + '\'' +
                ", jsUnit='" + jsUnit + '\'' +
                ", appearance='" + appearance + '\'' +
                ", trueExplain='" + trueExplain + '\'' +
                ", integrityExplain='" + integrityExplain + '\'' +
                ", usableExplain='" + usableExplain + '\'' +
                ", secureExplain='" + secureExplain + '\'' +
                ", createId=" + createId +
                ", createBy='" + createBy + '\'' +
                ", receptionTime=" + receptionTime +
                ", createTime='" + createTime + '\'' +
                ", auditorBy='" + auditorBy + '\'' +
                ", auditorId=" + auditorId +
                ", auditorTime='" + auditorTime + '\'' +
                ", unitBy='" + unitBy + '\'' +
                ", unitId=" + unitId +
                ", unitTime='" + unitTime + '\'' +
                ", receiveState=" + receiveState +
                ", illustrate='" + illustrate + '\'' +
                ", activitiId='" + activitiId + '\'' +
                ", writtenBy='" + writtenBy + '\'' +
                ", writtenTime='" + writtenTime + '\'' +
                ", yjState=" + yjState +
                ", jsState=" + jsState +
                ", siXingId=" + siXingId +
                ", categoryId=" + categoryId +
                ", filePath='" + filePath + '\'' +
                ", tenantCode='" + tenantCode + '\'' +
                ", biaoShi='" + biaoShi + '\'' +
                '}';
    }
}
